import { defineConfig } from 'vite';  
import vue from '@vitejs/plugin-vue';  
import ElementPlus from 'unplugin-element-plus/vite';  
import { fileURLToPath } from 'url'; // 导入 fileURLToPath  
  
export default defineConfig({  
  base: "./",  
  plugins: [  
    vue(),  
    ElementPlus()  
  ],  
  test: {  
    globals: true,  
    environment: 'happy-dom',  
    include: ['src/**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']  
  },  
  resolve: {  
    alias: {  
      '@': fileURLToPath(new URL('./src', import.meta.url)) // 使用导入的 fileURLToPath  
    }  
  },  
  
});